#include "cpp-httplibs/httplib.h"

int main()
{
    httplib::Server svr;
    svr.Get(
        "/hi", [](const httplib::Request &req, httplib::Response &rsp)
        { rsp.set_content("nihao", "text/plain;charset=utf-8"); });
    try {
        std::cout << "Starting server on 0.0.0.0:8080" << std::endl;
        
        if (!svr.listen("0.0.0.0", 8080)) {
            std::cerr << "Failed to start server!" << std::endl;
            return 1;
        }
    } catch (const std::exception& e) {
        std::cerr << "Exception: " << e.what() << std::endl;
        return 1;
    }
}